using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._DataManagementTools._Workspace
{
    /// <summary>
    /// <para>Create Database Connection String</para>
    /// <para>Creates a connection string that geoprocessing tools can use to connect to a database or an enterprise geodatabase.</para>
    /// <para>创建连接字符串，地理处理工具可以使用该字符串连接到数据库或企业级地理数据库。</para>
    /// </summary>    
    [DisplayName("Create Database Connection String")]
    public class CreateDatabaseConnectionString : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public CreateDatabaseConnectionString()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_database_platform">
        /// <para>Database Platform</para>
        /// <para><xdoc>
        ///   <para>Specifies the database platform to which the connection will be made.</para>
        ///   <bulletList>
        ///     <bullet_item>SQL Server—Connect to Microsoft SQL Server or Microsoft Azure SQL Database.</bullet_item><para/>
        ///     <bullet_item>Oracle—Connect to Oracle.</bullet_item><para/>
        ///     <bullet_item>DB2—Connect to IBM DB2 for Linux, UNIX, or Windows.</bullet_item><para/>
        ///     <bullet_item>PostgreSQL—Connect to PostgreSQL.</bullet_item><para/>
        ///     <bullet_item>Teradata—Connect to Teradata Data Warehouse Appliance.</bullet_item><para/>
        ///     <bullet_item>SAP HANA—Connect to SAP HANA.</bullet_item><para/>
        ///     <bullet_item>Dameng—Connect to Dameng.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定将建立连接的数据库平台。</para>
        ///   <bulletList>
        ///     <bullet_item>SQL Server - 连接到 Microsoft SQL Server 或 Microsoft Azure SQL 数据库。</bullet_item><para/>
        ///     <bullet_item>Oracle - 连接到 Oracle。</bullet_item><para/>
        ///     <bullet_item>DB2 - 连接到 IBM DB2 for Linux， UNIX， or Windows。</bullet_item><para/>
        ///     <bullet_item>PostgreSQL - 连接到 PostgreSQL。</bullet_item><para/>
        ///     <bullet_item>Teradata - 连接到 Teradata Data Warehouse Appliance。</bullet_item><para/>
        ///     <bullet_item>SAP HANA - 连接到 SAP HANA。</bullet_item><para/>
        ///     <bullet_item>Dameng - 连接到 Dameng。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// </param>
        /// <param name="_instance">
        /// <para>Instance</para>
        /// <para><xdoc>
        ///   <para>The database server or instance to which the connection will be made.</para>
        ///   <para>This parameter value depends on the Database Platform parameter value chosen.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>将建立连接的数据库服务器或实例。</para>
        ///   <para>此参数值取决于所选的数据库平台参数值。</para>
        /// </xdoc></para>
        /// </param>
        public CreateDatabaseConnectionString(_database_platform_value? _database_platform, object _instance)
        {
            this._database_platform = _database_platform;
            this._instance = _instance;
        }
        public override string ToolboxName => "Data Management Tools";

        public override string ToolName => "Create Database Connection String";

        public override string CallName => "management.CreateDatabaseConnectionString";

        public override List<string> AcceptEnvironments => ["workspace"];

        public override object[] ParameterInfo => [_database_platform.GetGPValue(), _instance, _account_authentication.GetGPValue(), _username, _password, _database, _object_name, _data_type, _feature_dataset, _schema, _version_type.GetGPValue(), _version, _date, _out_connection_string];

        /// <summary>
        /// <para>Database Platform</para>
        /// <para><xdoc>
        ///   <para>Specifies the database platform to which the connection will be made.</para>
        ///   <bulletList>
        ///     <bullet_item>SQL Server—Connect to Microsoft SQL Server or Microsoft Azure SQL Database.</bullet_item><para/>
        ///     <bullet_item>Oracle—Connect to Oracle.</bullet_item><para/>
        ///     <bullet_item>DB2—Connect to IBM DB2 for Linux, UNIX, or Windows.</bullet_item><para/>
        ///     <bullet_item>PostgreSQL—Connect to PostgreSQL.</bullet_item><para/>
        ///     <bullet_item>Teradata—Connect to Teradata Data Warehouse Appliance.</bullet_item><para/>
        ///     <bullet_item>SAP HANA—Connect to SAP HANA.</bullet_item><para/>
        ///     <bullet_item>Dameng—Connect to Dameng.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定将建立连接的数据库平台。</para>
        ///   <bulletList>
        ///     <bullet_item>SQL Server - 连接到 Microsoft SQL Server 或 Microsoft Azure SQL 数据库。</bullet_item><para/>
        ///     <bullet_item>Oracle - 连接到 Oracle。</bullet_item><para/>
        ///     <bullet_item>DB2 - 连接到 IBM DB2 for Linux， UNIX， or Windows。</bullet_item><para/>
        ///     <bullet_item>PostgreSQL - 连接到 PostgreSQL。</bullet_item><para/>
        ///     <bullet_item>Teradata - 连接到 Teradata Data Warehouse Appliance。</bullet_item><para/>
        ///     <bullet_item>SAP HANA - 连接到 SAP HANA。</bullet_item><para/>
        ///     <bullet_item>Dameng - 连接到 Dameng。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Database Platform")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public _database_platform_value? _database_platform { get; set; }

        public enum _database_platform_value
        {
            /// <summary>
            /// <para>SQL Server</para>
            /// <para>SQL Server—Connect to Microsoft SQL Server or Microsoft Azure SQL Database.</para>
            /// <para>SQL Server - 连接到 Microsoft SQL Server 或 Microsoft Azure SQL 数据库。</para>
            /// </summary>
            [Description("SQL Server")]
            [GPEnumValue("SQL_SERVER")]
            _SQL_SERVER,

            /// <summary>
            /// <para>Oracle</para>
            /// <para>Oracle—Connect to Oracle.</para>
            /// <para>Oracle - 连接到 Oracle。</para>
            /// </summary>
            [Description("Oracle")]
            [GPEnumValue("ORACLE")]
            _ORACLE,

            /// <summary>
            /// <para>DB2</para>
            /// <para>DB2—Connect to IBM DB2 for Linux, UNIX, or Windows.</para>
            /// <para>DB2 - 连接到 IBM DB2 for Linux， UNIX， or Windows。</para>
            /// </summary>
            [Description("DB2")]
            [GPEnumValue("DB2")]
            _DB2,

            /// <summary>
            /// <para>PostgreSQL</para>
            /// <para>PostgreSQL—Connect to PostgreSQL.</para>
            /// <para>PostgreSQL - 连接到 PostgreSQL。</para>
            /// </summary>
            [Description("PostgreSQL")]
            [GPEnumValue("POSTGRESQL")]
            _POSTGRESQL,

            /// <summary>
            /// <para>Teradata</para>
            /// <para>Teradata—Connect to Teradata Data Warehouse Appliance.</para>
            /// <para>Teradata - 连接到 Teradata Data Warehouse Appliance。</para>
            /// </summary>
            [Description("Teradata")]
            [GPEnumValue("TERADATA")]
            _TERADATA,

            /// <summary>
            /// <para>SAP HANA</para>
            /// <para>SAP HANA—Connect to SAP HANA.</para>
            /// <para>SAP HANA - 连接到 SAP HANA。</para>
            /// </summary>
            [Description("SAP HANA")]
            [GPEnumValue("SAP HANA")]
            _SAP_HANA,

            /// <summary>
            /// <para>Dameng</para>
            /// <para>Dameng—Connect to Dameng.</para>
            /// <para>Dameng - 连接到 Dameng。</para>
            /// </summary>
            [Description("Dameng")]
            [GPEnumValue("DAMENG")]
            _DAMENG,

        }

        /// <summary>
        /// <para>Instance</para>
        /// <para><xdoc>
        ///   <para>The database server or instance to which the connection will be made.</para>
        ///   <para>This parameter value depends on the Database Platform parameter value chosen.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>将建立连接的数据库服务器或实例。</para>
        ///   <para>此参数值取决于所选的数据库平台参数值。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Instance")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _instance { get; set; }


        /// <summary>
        /// <para>Database Authentication</para>
        /// <para><xdoc>
        ///   <para>Specifies the type of authentication that will be used.</para>
        ///   <bulletList>
        ///     <bullet_item>Checked—Database authentication will be used. An internal database user name and password are used to connect to the database. You aren't required to type your user name and password to create a connection; however, if you don't, you will be prompted to enter them when a connection is established. This is the default</bullet_item><para/>
        ///     <bullet_item>Unchecked—Operating system authentication will be used. You do not need to type a user name and password. The connection will be made with the user name and password that were used to log in to the operating system. If the login used for the operating system is not a valid geodatabase login, the connection will fail.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定将使用的身份验证类型。</para>
        ///   <bulletList>
        ///     <bullet_item>选中 - 将使用数据库身份验证。内部数据库用户名和密码用于连接到数据库。您无需键入用户名和密码即可创建连接;但是，如果不这样做，则在建立连接时将提示您输入它们。这是默认设置</bullet_item><para/>
        ///     <bullet_item>未选中 - 将使用操作系统身份验证。您无需键入用户名和密码。将使用用于登录操作系统的用户名和密码进行连接。如果用于操作系统的登录帐户不是有效的地理数据库登录帐户，则连接将失败。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Database Authentication")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _account_authentication_value _account_authentication { get; set; } = _account_authentication_value._true;

        public enum _account_authentication_value
        {
            /// <summary>
            /// <para>DATABASE_AUTH</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("DATABASE_AUTH")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>OPERATING_SYSTEM_AUTH</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("OPERATING_SYSTEM_AUTH")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Username</para>
        /// <para>The database user name that will be used when using database authentication.</para>
        /// <para>使用数据库身份验证时将使用的数据库用户名。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Username")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _username { get; set; } = null;


        /// <summary>
        /// <para>Password</para>
        /// <para>The database user password that will be used when using database authentication.</para>
        /// <para>使用数据库身份验证时将使用的数据库用户密码。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Password")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _password { get; set; } = null;


        /// <summary>
        /// <para>Database</para>
        /// <para>The name of the database to which you will connect. This parameter only applies to PostgreSQL and SQL Server platforms.</para>
        /// <para>要连接到的数据库的名称。此参数仅适用于 PostgreSQL 和 SQL Server 平台。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Database")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _database { get; set; } = null;


        /// <summary>
        /// <para>Dataset Object Name</para>
        /// <para>The name of the dataset or object in the database to which the connection string will point. This connection string can be used as a path to the specified dataset.</para>
        /// <para>连接字符串将指向的数据库中数据集或对象的名称。此连接字符串可用作指定数据集的路径。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Dataset Object Name")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _object_name { get; set; } = null;


        /// <summary>
        /// <para>Data type</para>
        /// <para>The type of dataset or object referred to in the dataset object name. If there are multiple objects with the same name in the database, you may need to specify the data type of the object for which you want to make a connection string.</para>
        /// <para>数据集对象名称中引用的数据集或对象的类型。如果数据库中有多个同名对象，则可能需要指定要为其创建连接字符串的对象的数据类型。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Data type")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _data_type { get; set; } = null;


        /// <summary>
        /// <para>Target Feature Dataset</para>
        /// <para>The name of the feature dataset containing the dataset or object for which you want to make a connection string. If the dataset is not in a feature dataset (for example, if it's at the root of the database), do not specify a target feature dataset.</para>
        /// <para>包含要为其创建连接字符串的数据集或对象的要素数据集的名称。如果数据集不在要素数据集中（例如，如果它位于数据库的根目录中），则不要指定目标要素数据集。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Target Feature Dataset")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _feature_dataset { get; set; } = null;


        /// <summary>
        /// <para>Schema (Oracle user schema geodatabases only)</para>
        /// <para>The user schema geodatabase to which you will connect. The tool will determine if it is connecting to an Oracle database that contains a user-schema geodatabase. If the Oracle database contains a user schema, this option is active; otherwise, it remains inactive. The default option for this parameter is to use the sde schema (master) geodatabase.</para>
        /// <para>要连接到的用户方案地理数据库。该工具将确定它是否正在连接到包含用户方案地理数据库的 Oracle 数据库。如果 Oracle 数据库包含用户架构，则此选项处于活动状态;否则，它将保持非活动状态。此参数的默认选项是使用 sde 方案（主）地理数据库。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Schema (Oracle user schema geodatabases only)")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _schema { get; set; } = null;


        /// <summary>
        /// <para>Version Type</para>
        /// <para><xdoc>
        ///   <para>Specifies the type of version to which you will connect. This parameter only applies when connecting to a geodatabase.</para>
        ///   <bulletList>
        ///     <bullet_item>Transactional—Connect to a transactional version. If Transactional is selected, the The following version will be used parameter will be populated with a list of transactional versions, and the Date and Time parameter will be inactive. This is the Default.</bullet_item><para/>
        ///     <bullet_item>Historical—Connect to an historical marker. If Historical is selected, the The following version will be used parameter will be populated with a list of historical markers, and the Date and Time parameter will be inactive.</bullet_item><para/>
        ///     <bullet_item>Point in time—Connect to a specific point in time. If Point in time is selected, the The following version will be used parameter will be inactive, and the Date and Time parameter will become active.</bullet_item><para/>
        ///     <bullet_item>Branch—Connect to the default branch version.</bullet_item><para/>
        ///   </bulletList>
        ///   <para>
        ///     <para>If Historical is selected and a name is not provided, the default transactional version is used. If Point in time is selected and a date is not provided in the Date and Time parameter, the default transactional version is used.</para>
        ///   </para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定要连接到的版本类型。此参数仅在连接到地理数据库时适用。</para>
        ///   <bulletList>
        ///     <bullet_item>事务性 - 连接到事务性版本。如果选择“事务性”，则“将使用以下版本”参数填充事务性版本列表，并且“日期和时间”参数将处于非活动状态。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>历史 - 连接到历史标记。如果选择“历史”，则将使用历史标记列表填充“将使用以下版本”参数，并且“日期和时间”参数将处于非活动状态。</bullet_item><para/>
        ///     <bullet_item>时间点 - 连接到特定时间点。如果选择“时间点”，则“将使用以下版本”参数将处于非活动状态，而“日期和时间”参数将变为活动状态。</bullet_item><para/>
        ///     <bullet_item>分支 （Branch） - 连接到默认分支版本。</bullet_item><para/>
        ///   </bulletList>
        ///   <para>
        ///     <para>如果选择了“历史”且未提供名称，则使用默认事务版本。如果选择了时间点，并且未在日期和时间参数中提供日期，则使用默认事务版本。</para>
        ///   </para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Version Type")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _version_type_value _version_type { get; set; } = _version_type_value._TRANSACTIONAL;

        public enum _version_type_value
        {
            /// <summary>
            /// <para>Transactional</para>
            /// <para>Transactional—Connect to a transactional version. If Transactional is selected, the The following version will be used parameter will be populated with a list of transactional versions, and the Date and Time parameter will be inactive. This is the Default.</para>
            /// <para>事务性 - 连接到事务性版本。如果选择“事务性”，则“将使用以下版本”参数填充事务性版本列表，并且“日期和时间”参数将处于非活动状态。这是默认设置。</para>
            /// </summary>
            [Description("Transactional")]
            [GPEnumValue("TRANSACTIONAL")]
            _TRANSACTIONAL,

            /// <summary>
            /// <para>Historical</para>
            /// <para>Historical—Connect to an historical marker. If Historical is selected, the The following version will be used parameter will be populated with a list of historical markers, and the Date and Time parameter will be inactive.</para>
            /// <para>历史 - 连接到历史标记。如果选择“历史”，则将使用历史标记列表填充“将使用以下版本”参数，并且“日期和时间”参数将处于非活动状态。</para>
            /// </summary>
            [Description("Historical")]
            [GPEnumValue("HISTORICAL")]
            _HISTORICAL,

            /// <summary>
            /// <para>Point in time</para>
            /// <para>Point in time—Connect to a specific point in time. If Point in time is selected, the The following version will be used parameter will be inactive, and the Date and Time parameter will become active.</para>
            /// <para>时间点 - 连接到特定时间点。如果选择“时间点”，则“将使用以下版本”参数将处于非活动状态，而“日期和时间”参数将变为活动状态。</para>
            /// </summary>
            [Description("Point in time")]
            [GPEnumValue("POINT_IN_TIME")]
            _POINT_IN_TIME,

            /// <summary>
            /// <para>Branch</para>
            /// <para>Branch—Connect to the default branch version.</para>
            /// <para>分支 （Branch） - 连接到默认分支版本。</para>
            /// </summary>
            [Description("Branch")]
            [GPEnumValue("BRANCH")]
            _BRANCH,

        }

        /// <summary>
        /// <para>The following version will be used</para>
        /// <para><xdoc>
        ///   <para>The geodatabase transactional version or historical marker to connect to. The default option uses the default transactional version.</para>
        ///   <para>If you choose a branch version type, the connection is always to the default branch version.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>要连接到的地理数据库事务版本或历史标记。默认选项使用默认事务版本。</para>
        ///   <para>如果选择分支版本类型，则始终连接到默认分支版本。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("The following version will be used")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _version { get; set; } = null;


        /// <summary>
        /// <para>Date and Time</para>
        /// <para><xdoc>
        ///   <para>The value representing the date and time that will be used to connect to the database. This parameter is used with archive-enabled data. Use the time picker to choose the appropriate date.</para>
        ///   <para>If manually entering a date, the following formats can be used:
        ///   <bulletList>
        ///     <bullet_item>6/9/2011 4:20:15 PM  </bullet_item><para/>
        ///     <bullet_item>6/9/2011 16:20:15  </bullet_item><para/>
        ///     <bullet_item>6/9/2011  </bullet_item><para/>
        ///     <bullet_item>4:20:15 PM  </bullet_item><para/>
        ///     <bullet_item>16:20:15  </bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        ///   <para>
        ///     <bulletList>
        ///       <bullet_item>If a time is entered without a date, the default date of December 30, 1899, will be used.</bullet_item><para/>
        ///       <bullet_item>If a date is entered without a time, the default time of 12:00:00 AM will be used.</bullet_item><para/>
        ///     </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>表示将用于连接到数据库的日期和时间的值。此参数用于启用存档的数据。使用时间选取器选择适当的日期。</para>
        /// <para>如果手动输入日期，可以使用以下格式：
        ///   <bulletList>
        ///     <bullet_item>2011/6/9 16：20：15</bullet_item><para/>
        ///     <bullet_item>6/9/2011 16:20:15</bullet_item><para/>
        ///     <bullet_item>6/9/2011</bullet_item><para/>
        ///     <bullet_item>下午4：20：15</bullet_item><para/>
        ///     <bullet_item>16:20:15</bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        ///   <para>
        ///     <bulletList>
        ///       <bullet_item>如果输入的时间没有日期，则将使用默认日期 1899 年 12 月 30 日。</bullet_item><para/>
        ///       <bullet_item>如果输入的日期没有时间，则将使用默认时间 12：00：00 AM。</bullet_item><para/>
        ///     </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Date and Time")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _date { get; set; } = null;


        /// <summary>
        /// <para>CIMDATA Connection String</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("CIMDATA Connection String")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _out_connection_string { get; set; }


        public CreateDatabaseConnectionString SetEnv(object workspace = null)
        {
            base.SetEnv(workspace: workspace);
            return this;
        }

    }

}